﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace quanlynhasach
{
    public partial class HoaDon : Form
    {
        public HoaDon()
        {
            InitializeComponent();
        }

        private void HoaDon_Load(object sender, EventArgs e)
        {
        }

        public void source(int x, string y)
        {
            if (x == 1)
            {
                Microsoft.Reporting.WinForms.ReportDataSource reportDataSource1 = new Microsoft.Reporting.WinForms.ReportDataSource();
                reportDataSource1.Name = "DataSet1";
                reportDataSource1.Value = this.ChiTietHoaDonBindingSource;
                this.reportViewer1.LocalReport.DataSources.Add(reportDataSource1);
                this.reportViewer1.LocalReport.ReportEmbeddedResource = "quanlynhasach.HoaDonBan.rdlc";
                this.ChiTietHoaDonTableAdapter.Fill(this.Hoadonban.ChiTietHoaDon, y);
                this.reportViewer1.RefreshReport();
            }
            else
            {
                Microsoft.Reporting.WinForms.ReportDataSource reportDataSource1 = new Microsoft.Reporting.WinForms.ReportDataSource();
                reportDataSource1.Name = "DataSet1";
                reportDataSource1.Value = this.ChiTietPhieuNhapBindingSource;
                this.reportViewer1.LocalReport.DataSources.Add(reportDataSource1);
                this.reportViewer1.LocalReport.ReportEmbeddedResource = "quanlynhasach.HoaDonNhap.rdlc";
                this.ChiTietPhieuNhapTableAdapter.Fill(this.Hoadonnhap.ChiTietPhieuNhap, y);
                this.reportViewer1.RefreshReport();
            }
        }
    }
}
